<?php
 include("../util/session.php"); 

	require_once ("../config.inc.php");
	require_once ("../include/mysql.inc.php");
	require_once ("../include/link.inc.php");
	
	$linkDao = new Link();
	$rows = $linkDao->query();
?>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title></title>
	</head>
	<body>
		<?php
			require './inc_header.php';
		?>
		<a align="left" href="linkAdd.php">添加</a>
		<table width="800" border="1">
			<tr>
				<td width="10%">编号</td>
				<td width="20%">名称</td>
				<td width="40%">地址</td>
				<td width="10%">点击数</td>
				<td width="20%">操作</td>
			</tr>
			
			<?php 
				if ($rows) {
					foreach ($rows as $value) {
			?>
					<tr>
						<td><?php echo $value[id]?></td>
						<td><?php echo $value[name]?></td>    
						<td><?php echo $value[link]?></td>
						<td><?php echo $value[num]?></td>
						<td><a href="../action/link/deleteLink.php?id=<?php echo $value[id] ?>">删除</a> | <a href="linkUpdate.php?id=<?php echo $value[id] ?>">修改</a></td>
					</tr>
			<?php
					}
				}
			?>
			
		</table>
	</body>
</html>